<?php
namespace app\talbum\validata;
use think\Validate;
/**
 *时光相册验证类 
 */
class TablumValidata extends Validate
{
      protected $rule =   [
        'albumname'  => 'require|max:20',
        'videoname' =>'require|max:20',
        'Openid'   => 'max:50|alphaDash',
        'describe' => 'max:200',  
        'Token' => 'max:40|alphaDash',
        'albumregion'=> 'max:200|chsDash',
        'permissions'=>'require|max:1|number',
        'page'=>'number',
        'limit'=>'number|max:2',
        'albumid'=>'require|number',
        'albumidtwo'=>'number',
        'picsid'=>'require|number',
        'videoid'=>'require|number',
        'picsids'=>'require',
    ];
    
    protected $message  =   [
        'albumname.require' => '相册名是必须的',
        'albumname.max' => '相册名超过了字符限制',
    
        'Openid.max'     => 'OpenId超过了字符限制',
        'Openid.alphaDash' => 'Openid含有不符合规则的字符',
        'describe.max'   => '相册描述超过了字符限制',
      
        'albumregion.max'  => '相册地址超过了字符限制',
      
        'permissions.require'        => '权限是必须的', 
        'permissions.max'        => '权限超过了字符限制',    
        'permissions.number'        => '权限只能是数字1,2,3',  
        'page.number' =>'页数只能是数字',
        'limit.number'=>'limit只能是数字',
        'page.max'=>'limit最大为99',
        'albumid.require'=>'相册id是必须的',
        'albumid.number'=>'相册id存在字符不合规',
        'picsid.require'=>'图片id是必须的',
        'picsid.number'=>'图片id格式不符',
        
        
    ];
/* protected $rule = [
        ['albumname','require|max:20|chsDash','相册名是必须的|相册名超过了字符限制|相册名含有不符合规则的字符'],
        ['Openid','max:50|alphaDash','OpenId超过了字符限制|Openid含有不符合规则的字符'],
        ['describe','max:200|chsDash','相册描述超过了字符限制|相册描述含有不符合规则的字符'],
        ['albumregion','max:200|chsDash','相册地址超过了字符限制|相册地址含有不符合规则的字符'],
        ['permissions','require|max:1|number','权限是必须的|权限超过了字符限制|权限只能是数字'],
        

    
    ];*/

      protected $scene = [
        'add_album' => ['albumname','Openid','describe','albumregion','permissions','Token'], // 时光相册
        'page' =>['page','limit','albumidtwo'],
        'upload_desc' =>['describe'],
        'get_album_photos'=>['albumid','page','limit'],
        'delete_album_photo'=>['picsid'],
        'comment_list'=>['page','limit'],
        'comment' =>['picsid','content'],//添加相册评论
        'video_comment' =>['videoid','content'],//添加相册评论
       'del_many_photos'=>['picsids'],//删除全部图片
       'del_albums'=>['albumid'],
       'add_video'=>['videoname','Openid','describe','albumregion','permissions'], // 添加视频
       'add_points'=>['picsid','albumid'],
       'add_pointv'=>['videoid'],
       'get_counts' =>['videoid'],
       
    ];
}
?>